@import "../components/dropdown";
@import "../components/link";
@import "../utils/flex";
@import "../base/spacing";
@import "../base/colors";

.toolbar-dropdown-menu-btn {
  position: relative;
  margin-left: 5px;

  .fa-rocket,
  .fa-bars {
    display: block;
  }

  progress {
    position: absolute;
    // TODO: This is jank. Instead of automatically opening the menu and showing this progress
    // bar, let's add a similar pop up like Chrome does on the bottom of the
    // screen. -tbv
    bottom: -43%;
    left: 0;
    width: 100%;
    height: 100%;
  }
}

.toolbar-dropdown {
  padding-top: 10px;
  margin-right: -4px;
  z-index: 1000;

  .dropdown-items.compact {
    padding: 5px 0;
  }

  h2 {
    font-size: 12px;
    font-weight: 500;
    margin: 0;
  }

  hr {
    // TODO: remove this once we pull out photonkit -tbv
    margin: 5px 0;
    border-bottom: 1px solid @border-menu;
  }

  .list {
    padding: 4px 0;

    hr {
      margin: 2px 0;
    }
  }

  .list-item {
    position: relative;
    padding: 3px 8px;
    cursor: pointer;

    * {
      cursor: pointer;
    }

    i {
      width: 20px;
      text-align: center;
      color: @color-text--muted;
    }

    .fa-share,
    .fa-plus {
      font-size: 13px;
    }

    .fa-caret-right {
      position: absolute;
      right: 3px;
      top: 7px;
    }

    &:hover {
      background: @background-menu;
    }
  }

  .grid {
    padding: @padding-component @padding-component @padding-component--tight @padding-component;
    &:extend(.flex);
    justify-content: space-between;

    // Make the last item in the flex container float to the left
    &.default:after {
      content: '';
      flex: auto;
      flex-basis: 33%
    }
  }
}

.page-dropdown-menu {
  height: 100%;

  .dropdown-items {
    width: 190px;
    font-size: 13px;

    // alter the alignment of the icons
    i {
      text-align: center;
      position: relative;
      left: -4px;
    }
  }
}

.toolbar-input-group .syncfolder-dropdown-menu {
  margin-left: 2px;

  .toolbar-dropdown {
    margin: 0;
    padding: 0;
    top: 12px;
    right: -8px;
  }

  .dropdown-items {
    width: 150px;
    font-size: 13px;
  }
}

.toolbar-updates {
  display: inline-block;
  position: relative;

  .icon-up-circled {
    color: #008fe8;
  }
}

.toolbar-updates-dropdown {

  .toolbar-updates-dropdown-inner {
    position: absolute;
    z-index: 1000;
    line-height: 1.3;
    font-size: 12px;
    background: #fff;
    width: 199px;
    padding: 10px 14px;
    left: -170px;

    a {
      &:extend(.link);

      &:hover {
        &:extend(.link:hover);
      }
    }
  }
}

.toolbar-site-info-dropdown {
  font-size: 12.5px;

  a {
    &:extend(.link);
  }

  a:hover {
    &:extend(.link:hover);
  }

  .dropdown-items {
    width: 300px;
    left: -2px;

    &::before {
      left: 25px;
    }
  }

  .details {
    padding: 15px;

    small {
      font-size: 12px;
      color: @color-text--muted;
    }
  }

  .details-title {
    font-weight: 500;
  }

  .details-desc {
    margin-bottom: 0;
    line-height: 1.3;
  }

  .perms-heading {
    font-size: 11px;
    font-weight: 500;
    color: @color-text--muted;
    letter-spacing: .4px;
    text-transform: uppercase;
    margin: 5px 0 5px 15px;
  }

  .perms {
    background: #fafafa;
    border-radius: 0 0 4px 4px;
    overflow-y: auto;
    overflow-x: hidden;
    max-height: ~"calc(100vh - 300px)";

    i {
      color: #777;
      margin-right: 7px;
    }

    .perm {
      border-top: 1px solid #eee;
    }

    label {
      &:extend(.flex);
      flex-wrap: nowrap;
      align-items: center;
      padding: 8px 15px;
      margin: 0;
      font-weight: 400;

      span {
        max-width: 230px;
        overflow: hidden;
        text-overflow: ellipsis;
      }
    }

    input {
      height: auto;
      margin: 0;
      margin-left: auto;
    }
  }
}